Skip to content

Feat/challenge 2#3

Open
yasirelbouazzati wants to merge 20 commits intomainfrom
feat/challenge-2
Open

Feat/challenge 2#3
yasirelbouazzati wants to merge 20 commits intomainfrom
feat/challenge-2

Conversation

@yasirelbouazzati
Copy link
Owner

is almost complete

const COUNTRIES = ["United Kingdom", "Italy", "France", "Portugal", "Greece"];

const extractCountriesWithFiveCharactersOrFewer = function (countries) {
const countriesFilter = countries.filter((countrie) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const countriesFilter = countries.filter((countrie) => {
const countriesFilter = countries.filter((country) => {

return word.length >= 5;
};

const longWord = words.filter((word) => filterLongWords(word));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const longWord = words.filter((word) => filterLongWords(word));
const longWord = words.filter(filterLongWords);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFX: use reduce

];

function getTotalVoters(voters) {
const totalVoters = voters.filter((voter) => voter.voted).length;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution! Are you able to explain what is it doing? 😉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFX: use reduce

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFX: use reduce

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIX: add tests job

"version": "1.0.0",
"type": "module",
"main": "index.js",
"dependencies": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need three devDependencies

"@babel/plugin-transform-modules-commonjs"
"jest"
"prettier"
FIX: remove all dependencies and install only required devDependencies.

"prettier": "^3.2.2"
},
"name": "09_javascript_array",
"description": "<figure style=\"text-align: center\"> <img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/640px-JavaScript-logo.png\" alt=\"DOM Tree\" width=\"100\" /> <figcaption>JavaScript</figcaption> </figure>",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIX: remove description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants